home *** CD-ROM | disk | FTP | other *** search
- PROGRAM TPTest;
-
- { Simple test program for ExKey unit, INT 16 keyboard handler. The routine
- should display the name of any function key as you press it, including
- the F11 and F12 keys which are NOT supported by the default routine. If this
- program does NOT run properly on your machine, it probably means that your
- BIOS is not able to handle an extended AT/PS2 style keyboard. Any
- questions about this program may be addressed to the author:
-
- Aubrey Scoon
- Scoon Consultancy Services
- 49 Honeyhill Road,
- Bracknell,
- Berkshire.
- RG12 1YH
- U.K.
-
- Alternatively leave a message to me on Hawk's Castle BBS (0344) 411621 or
- Mission Impossible BBS (0602) 654329 (both 24 hour 300,1200,2400,9600HST,
- 8 bits, No parity, 1 Stopbit)
- }
-
- USES
-
- CRT,ExKey;
-
- VAR
-
- ch: char;
-
- BEGIN
-
- SetKeyVector; { Install new INT 16 keyboard handler }
-
- ClrScr;
-
- IF (Ext_Keyboard_Present=TRUE) THEN
- Writeln('101/102 key keyboard detected');
-
- Writeln;
-
- Writeln('Press ESC at any time to exit');
- Writeln;
-
- ch:=#255; { Dummy value to fool "while" routine }
-
- WHILE (ch<>#27) DO { check for escape }
-
- BEGIN
-
- ch:=Readkey;
-
- IF (ch<>#0) THEN
-
- BEGIN
-
- IF (ch<>#27) THEN Writeln('That was not a function key');
-
- END
-
- ELSE
-
- BEGIN
-
- Write('You have pressed ');
- ch:=Readkey;
-
- CASE ch OF
-
- #59: Writeln('F1');
- #60: Writeln('F2');
- #61: Writeln('F3');
- #62: Writeln('F4');
- #63: Writeln('F5');
- #64: Writeln('F6');
- #65: Writeln('F7');
- #66: Writeln('F8');
- #67: Writeln('F9');
- #68: Writeln('F10');
- #133: Writeln('F11');
- #134: Writeln('F12');
-
- ELSE
-
- Writeln('a special key or combination of keys');
-
- END; { CASE }
-
- END; { IF }
-
- END; { WHILE }
-
- RestoreKeyVector; { restore default INT 16 handler }
-
- END.